<HTML><HEAD><TITLE>wam(+PredSpec, +Module)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">library(asm)</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>wam(+PredSpec, +Module)</H1>
Prints the formatted WAM code for predicate PredSpec from module Module.
<DL>
<DT><EM>+PredSpec</EM></DT>
<DD>Atom, or Atom/Integer
</DD>
<DT><EM>+Module</EM></DT>
<DD>Atom.
</DD>
</DL>
<H2>Description</H2>
   Prints the WAM instructions representing the predicate specified by
   PredSpec in a formatted form. Requires the library asm to be loaded.

<P>
   If PredSpec is an atom (i.e. no arity is given), then a predicate with
   that name is printed, and if there are more than one predicate defined
   (i.e. same name but different arities), then these different predicates
   will be printed by backtracking.

<P>
   This predicate is intended as a replacement for the lower level als/1,
   which performs the same function. The differences are that the abstract
   instruction names are printed in a more human oriented form (rather than
   the internal names used by ECLiPSe), and labels and their references are
   printed symbolically. Note that the predicate is implemented via the
   disasm/3 predicate of the library, and hence the same restrictions
   applies: it cannot be used to print the code for dynamic predicates.

<P>

<H3>Fail Conditions</H3>
   If PredSpec is a dynamic predicate.
<H3>Resatisfiable</H3>
   Yes.
<H3>Exceptions</H3>
<DL>
<DT><EM>(5) type error </EM>
<DD>PredSpec or Module not in correct form.
<DT><EM>(60) referring to an undefined procedure </EM>
<DD>PredSpec not defined in module Module.
<DT><EM>(80) not a module </EM>
<DD>Module is not an existing module.
</DL>
<H2>See Also</H2>
<A HREF="../../lib/asm/disasm-2.html">disasm / 2</A>, <A HREF="../../lib/asm/disasm-3.html">disasm / 3</A>, <A HREF="../../lib/asm/wam-1.html">wam / 1</A>, <A HREF="../../kernel/compiler/als-1.html">als / 1</A>
</BODY></HTML>
